package edu.zut.hb.bailan0.consumer;

import edu.zut.hb.bailan0.MyBatis.dao.ConsumerDao;
import edu.zut.hb.bailan0.MyBatis.entity.Consumer;
import edu.zut.hb.bailan0.MyBatis.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import java.util.List;
//getConsumer
public class getConsumer {
    public String getConsumername(){
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        ConsumerDao dao  =  sqlSession.getMapper(ConsumerDao.class);
        List<Consumer> consumers = dao.selectConsumer();
        return consumers.get(0).getName();
    }
}
